package com.dian.diabetes.db.dao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.dian.diabetes.db.dao.User;
import com.dian.diabetes.db.dao.Diabetes;
import com.dian.diabetes.db.dao.DiabetesCache;
import com.dian.diabetes.db.dao.Sport;
import com.dian.diabetes.db.dao.DefSet;
import com.dian.diabetes.db.dao.Eat;
import com.dian.diabetes.db.dao.Report;
import com.dian.diabetes.db.dao.Alarm;
import com.dian.diabetes.db.dao.UserSet;
import com.dian.diabetes.db.dao.Common;
import com.dian.diabetes.db.dao.UserInfo;
import com.dian.diabetes.db.dao.Plan;
import com.dian.diabetes.db.dao.Medicine;
import com.dian.diabetes.db.dao.News;
import com.dian.diabetes.db.dao.Favorate;
import com.dian.diabetes.db.dao.Normal;
import com.dian.diabetes.db.dao.Indicate;
import com.dian.diabetes.db.dao.IndicateValue;
import com.dian.diabetes.db.dao.AlarmHistory;

import com.dian.diabetes.db.dao.UserDao;
import com.dian.diabetes.db.dao.DiabetesDao;
import com.dian.diabetes.db.dao.DiabetesCacheDao;
import com.dian.diabetes.db.dao.SportDao;
import com.dian.diabetes.db.dao.DefSetDao;
import com.dian.diabetes.db.dao.EatDao;
import com.dian.diabetes.db.dao.ReportDao;
import com.dian.diabetes.db.dao.AlarmDao;
import com.dian.diabetes.db.dao.UserSetDao;
import com.dian.diabetes.db.dao.CommonDao;
import com.dian.diabetes.db.dao.UserInfoDao;
import com.dian.diabetes.db.dao.PlanDao;
import com.dian.diabetes.db.dao.MedicineDao;
import com.dian.diabetes.db.dao.NewsDao;
import com.dian.diabetes.db.dao.FavorateDao;
import com.dian.diabetes.db.dao.NormalDao;
import com.dian.diabetes.db.dao.IndicateDao;
import com.dian.diabetes.db.dao.IndicateValueDao;
import com.dian.diabetes.db.dao.AlarmHistoryDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userDaoConfig;
    private final DaoConfig diabetesDaoConfig;
    private final DaoConfig diabetesCacheDaoConfig;
    private final DaoConfig sportDaoConfig;
    private final DaoConfig defSetDaoConfig;
    private final DaoConfig eatDaoConfig;
    private final DaoConfig reportDaoConfig;
    private final DaoConfig alarmDaoConfig;
    private final DaoConfig userSetDaoConfig;
    private final DaoConfig commonDaoConfig;
    private final DaoConfig userInfoDaoConfig;
    private final DaoConfig planDaoConfig;
    private final DaoConfig medicineDaoConfig;
    private final DaoConfig newsDaoConfig;
    private final DaoConfig favorateDaoConfig;
    private final DaoConfig normalDaoConfig;
    private final DaoConfig indicateDaoConfig;
    private final DaoConfig indicateValueDaoConfig;
    private final DaoConfig alarmHistoryDaoConfig;

    private final UserDao userDao;
    private final DiabetesDao diabetesDao;
    private final DiabetesCacheDao diabetesCacheDao;
    private final SportDao sportDao;
    private final DefSetDao defSetDao;
    private final EatDao eatDao;
    private final ReportDao reportDao;
    private final AlarmDao alarmDao;
    private final UserSetDao userSetDao;
    private final CommonDao commonDao;
    private final UserInfoDao userInfoDao;
    private final PlanDao planDao;
    private final MedicineDao medicineDao;
    private final NewsDao newsDao;
    private final FavorateDao favorateDao;
    private final NormalDao normalDao;
    private final IndicateDao indicateDao;
    private final IndicateValueDao indicateValueDao;
    private final AlarmHistoryDao alarmHistoryDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        diabetesDaoConfig = daoConfigMap.get(DiabetesDao.class).clone();
        diabetesDaoConfig.initIdentityScope(type);

        diabetesCacheDaoConfig = daoConfigMap.get(DiabetesCacheDao.class).clone();
        diabetesCacheDaoConfig.initIdentityScope(type);

        sportDaoConfig = daoConfigMap.get(SportDao.class).clone();
        sportDaoConfig.initIdentityScope(type);

        defSetDaoConfig = daoConfigMap.get(DefSetDao.class).clone();
        defSetDaoConfig.initIdentityScope(type);

        eatDaoConfig = daoConfigMap.get(EatDao.class).clone();
        eatDaoConfig.initIdentityScope(type);

        reportDaoConfig = daoConfigMap.get(ReportDao.class).clone();
        reportDaoConfig.initIdentityScope(type);

        alarmDaoConfig = daoConfigMap.get(AlarmDao.class).clone();
        alarmDaoConfig.initIdentityScope(type);

        userSetDaoConfig = daoConfigMap.get(UserSetDao.class).clone();
        userSetDaoConfig.initIdentityScope(type);

        commonDaoConfig = daoConfigMap.get(CommonDao.class).clone();
        commonDaoConfig.initIdentityScope(type);

        userInfoDaoConfig = daoConfigMap.get(UserInfoDao.class).clone();
        userInfoDaoConfig.initIdentityScope(type);

        planDaoConfig = daoConfigMap.get(PlanDao.class).clone();
        planDaoConfig.initIdentityScope(type);

        medicineDaoConfig = daoConfigMap.get(MedicineDao.class).clone();
        medicineDaoConfig.initIdentityScope(type);

        newsDaoConfig = daoConfigMap.get(NewsDao.class).clone();
        newsDaoConfig.initIdentityScope(type);

        favorateDaoConfig = daoConfigMap.get(FavorateDao.class).clone();
        favorateDaoConfig.initIdentityScope(type);

        normalDaoConfig = daoConfigMap.get(NormalDao.class).clone();
        normalDaoConfig.initIdentityScope(type);

        indicateDaoConfig = daoConfigMap.get(IndicateDao.class).clone();
        indicateDaoConfig.initIdentityScope(type);

        indicateValueDaoConfig = daoConfigMap.get(IndicateValueDao.class).clone();
        indicateValueDaoConfig.initIdentityScope(type);

        alarmHistoryDaoConfig = daoConfigMap.get(AlarmHistoryDao.class).clone();
        alarmHistoryDaoConfig.initIdentityScope(type);

        userDao = new UserDao(userDaoConfig, this);
        diabetesDao = new DiabetesDao(diabetesDaoConfig, this);
        diabetesCacheDao = new DiabetesCacheDao(diabetesCacheDaoConfig, this);
        sportDao = new SportDao(sportDaoConfig, this);
        defSetDao = new DefSetDao(defSetDaoConfig, this);
        eatDao = new EatDao(eatDaoConfig, this);
        reportDao = new ReportDao(reportDaoConfig, this);
        alarmDao = new AlarmDao(alarmDaoConfig, this);
        userSetDao = new UserSetDao(userSetDaoConfig, this);
        commonDao = new CommonDao(commonDaoConfig, this);
        userInfoDao = new UserInfoDao(userInfoDaoConfig, this);
        planDao = new PlanDao(planDaoConfig, this);
        medicineDao = new MedicineDao(medicineDaoConfig, this);
        newsDao = new NewsDao(newsDaoConfig, this);
        favorateDao = new FavorateDao(favorateDaoConfig, this);
        normalDao = new NormalDao(normalDaoConfig, this);
        indicateDao = new IndicateDao(indicateDaoConfig, this);
        indicateValueDao = new IndicateValueDao(indicateValueDaoConfig, this);
        alarmHistoryDao = new AlarmHistoryDao(alarmHistoryDaoConfig, this);

        registerDao(User.class, userDao);
        registerDao(Diabetes.class, diabetesDao);
        registerDao(DiabetesCache.class, diabetesCacheDao);
        registerDao(Sport.class, sportDao);
        registerDao(DefSet.class, defSetDao);
        registerDao(Eat.class, eatDao);
        registerDao(Report.class, reportDao);
        registerDao(Alarm.class, alarmDao);
        registerDao(UserSet.class, userSetDao);
        registerDao(Common.class, commonDao);
        registerDao(UserInfo.class, userInfoDao);
        registerDao(Plan.class, planDao);
        registerDao(Medicine.class, medicineDao);
        registerDao(News.class, newsDao);
        registerDao(Favorate.class, favorateDao);
        registerDao(Normal.class, normalDao);
        registerDao(Indicate.class, indicateDao);
        registerDao(IndicateValue.class, indicateValueDao);
        registerDao(AlarmHistory.class, alarmHistoryDao);
    }
    
    public void clear() {
        userDaoConfig.getIdentityScope().clear();
        diabetesDaoConfig.getIdentityScope().clear();
        diabetesCacheDaoConfig.getIdentityScope().clear();
        sportDaoConfig.getIdentityScope().clear();
        defSetDaoConfig.getIdentityScope().clear();
        eatDaoConfig.getIdentityScope().clear();
        reportDaoConfig.getIdentityScope().clear();
        alarmDaoConfig.getIdentityScope().clear();
        userSetDaoConfig.getIdentityScope().clear();
        commonDaoConfig.getIdentityScope().clear();
        userInfoDaoConfig.getIdentityScope().clear();
        planDaoConfig.getIdentityScope().clear();
        medicineDaoConfig.getIdentityScope().clear();
        newsDaoConfig.getIdentityScope().clear();
        favorateDaoConfig.getIdentityScope().clear();
        normalDaoConfig.getIdentityScope().clear();
        indicateDaoConfig.getIdentityScope().clear();
        indicateValueDaoConfig.getIdentityScope().clear();
        alarmHistoryDaoConfig.getIdentityScope().clear();
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public DiabetesDao getDiabetesDao() {
        return diabetesDao;
    }

    public DiabetesCacheDao getDiabetesCacheDao() {
        return diabetesCacheDao;
    }

    public SportDao getSportDao() {
        return sportDao;
    }

    public DefSetDao getDefSetDao() {
        return defSetDao;
    }

    public EatDao getEatDao() {
        return eatDao;
    }

    public ReportDao getReportDao() {
        return reportDao;
    }

    public AlarmDao getAlarmDao() {
        return alarmDao;
    }

    public UserSetDao getUserSetDao() {
        return userSetDao;
    }

    public CommonDao getCommonDao() {
        return commonDao;
    }

    public UserInfoDao getUserInfoDao() {
        return userInfoDao;
    }

    public PlanDao getPlanDao() {
        return planDao;
    }

    public MedicineDao getMedicineDao() {
        return medicineDao;
    }

    public NewsDao getNewsDao() {
        return newsDao;
    }

    public FavorateDao getFavorateDao() {
        return favorateDao;
    }

    public NormalDao getNormalDao() {
        return normalDao;
    }

    public IndicateDao getIndicateDao() {
        return indicateDao;
    }

    public IndicateValueDao getIndicateValueDao() {
        return indicateValueDao;
    }

    public AlarmHistoryDao getAlarmHistoryDao() {
        return alarmHistoryDao;
    }

}
